public class Main {
    public static void main(String[] args) {

        IVisitor visitorLibrary = new Library();
        IVisitor visitorDormitory = new Dormitory();
        IVisitor visitorClassroom = new Classroom();

        Student demoStudent = new Student();
        demoStudent.setStudentName("晓美焰");
        demoStudent.setStudentNo("2024015444");

        Teacher demoTeacher = new Teacher();
        demoTeacher.setTeacherName("鹿目圆");
        demoTeacher.setTeacherNo("2024015555");

        Professor demoProfessor = new Professor();
        demoProfessor.setProfessorName("虚渊玄");
        demoProfessor.setProfessorNo("2024015666");

        //访问学生
        //发放校园卡
        System.out.println(demoStudent.accept(visitorLibrary));
        //分配寝室
        System.out.println(demoStudent.accept(visitorDormitory));
        //学生上课
        System.out.println(demoStudent.accept(visitorClassroom));
        System.out.println("-----------------------------------------------------");
        //访问老师
        //发放校园卡
        System.out.println(demoTeacher.accept(visitorLibrary));
        //分配住宿
        System.out.println(demoTeacher.accept(visitorDormitory));
        //老师讲课
        System.out.println(demoTeacher.accept(visitorClassroom));
        System.out.println("-----------------------------------------------------");
        //访问教授
        //发放校园卡
        System.out.println(demoProfessor.accept(visitorLibrary));
        //分配住宿
        System.out.println(demoProfessor.accept(visitorDormitory));
        //教授听课
        System.out.println(demoProfessor.accept(visitorClassroom));

    }
  }